<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        /*
        查询URL字符串
        */
        let getQueryStringArgs = function () {
            let qs = (location.search.length > 0 ? location.search.substring(1) : ""),
            //保存数据对象
                args = {};
            //把每个参数添加到 args 对象
            for (let item of qs.split("&").map(kv => kv.split("="))) {
                let name = decodeURIComponent(item[0]),
                    value = decodeURIComponent(item[1]);
                if (name.length) {
                    args[name] = value;
                }
            }
            return args;
        }
        //console.log(getQueryStringArgs);
        
    </script>
</body>

</html>